import store from "@/store";
import dayjs from "dayjs";
console.log(88);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

export const formBase = [
  {
    label: "报价名称",
    type: "input",
    field: "name",
  },
  {
    label: "仓库",
    type: "select",
    field: "warehouseId",
    optionsKey: "warehouseName",
    optionsValue: "id",
    options: store.state.custom_dict.warehouse,
  },
  // {
  //   label: "目的地",
  //   type: "select",
  //   field: "destinationId",
  //   optionsKey: "destinationName",
  //   optionsValue: "destinationId",
  //   options: store.state.custom_dict.destination,
  // },
  {
    label: "快件类型",
    type: "select",
    field: "cargoTypeId",
    optionsKey: "cargoName",
    optionsValue: "id",
    options: store.state.custom_dict.category,
  },
  {
    label: "时效",
    type: "select",
    field: "timeEfficiencyId",
    optionsKey: "name",
    optionsValue: "id",
    options: store.state.custom_dict.timely,
  },
  {
    label: "店铺",
    type: "select",
    field: "shopId",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop,
  },
  {
    label: "自提点",
    type: "select",
    required: true,
    field: "selfPickupPointId",
    optionsKey: "selfPickupPointName",
    optionsValue: "id",
    options: [],
  },
  {
    label: "费用类型",
    type: "select",
    field: "feeType",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "自提价格",
        value: 5,
      },
    ],
  },
  {
    label: "测算重量",
    type: "inputNumber",
    required: true,
    field: "calculateWeight",
  },
];
export const tableBase = [
  {
    label: "编号",
    prop: "id",
    width: "200",
  },
  {
    label: "自提点",
    prop: "selfPickupPointName",
    width: 300,
    operate: {
      required: true,
      type: "select",
      field: "selfPickupPointId",
      optionsKey: "selfPickupPointName",
      optionsValue: "id",
      options: [],
    },
  },
  {
    label: "时效",
    prop: "timeEfficiencyName",
    width: 300,
    operate: {
      required: true,
      type: "select",
      field: "timeEfficiencyId",
      optionsKey: "name",
      optionsValue: "id",
      options: store.state.custom_dict.timely,
    },
  },
  {
    label: "名称",
    prop: "name",
    width: "200",
    operate: {
      type: "input",
      field: "name",
    },
  },
  {
    label: "店铺",
    prop: "shopName",
    width: 150,
    operate: {
      type: "select",
      field: "shopId",
      optionsKey: "shopName",
      optionsValue: "id",
      options: store.state.custom_dict.shop,
    },
  },
  {
    label: "仓库",
    prop: "warehouseName",
    width: 150,
    operate: {
      type: "select",
      field: "warehouseName",
      field: "warehouseId",
      optionsKey: "warehouseName",
      optionsValue: "id",
      options: store.state.custom_dict.warehouse,
    },
  },
  {
    label: "目的地",
    prop: "destinationName",
    width: 150,
    operate: {
      type: "select",
      field: "destinationId",
      optionsKey: "destinationName",
      optionsValue: "destinationId",
      options: store.state.custom_dict.destination,
    },
  },
  {
    label: "费用类型",
    prop: "feeType",
    width: 100,
    operate: {
      type: "select",
      field: "feeType",
      optionsKey: "label",
      optionsValue: "value",
      options: [
        {
          label: "自提价格",
          value: 5,
        },
      ],
    },
    slotName: "feeType",
  },
  {
    label: "快件类型",
    prop: "cargoName",
    width: 300,
    operate: {
      required: true,
      type: "select",
      field: "cargoTypeId",
      optionsKey: "cargoName",
      optionsValue: "id",
      options: store.state.custom_dict.category,
    },
  },
  {
    label: "重量模式",
    prop: "modeWeight",
    width: 300,
    operate: {
      type: "select",
      field: "modeWeight",
      optionsKey: "label",
      optionsValue: "label",
      options: [
        {
          label: "实际重量",
        },
        {
          label: "0.01进位",
        },
        {
          label: "0.02进位",
        },
        {
          label: "0.03进位",
        },
        {
          label: "0.04进位",
        },
        {
          label: "0.05进位",
        },
        {
          label: "0.06进位",
        },
        {
          label: "0.07进位",
        },
        {
          label: "0.08进位",
        },
        {
          label: "0.09进位",
        },
        {
          label: "0.1进位",
        },
        { label: "0.11进位" },
        { label: "0.2进位" },
        { label: "0.21进位" },
        { label: "0.5进位" },
        { label: "0.51进位" },
        { label: "0,5进位" },
        { label: "1,5进位" },
        { label: "2,5进位" },
        { label: "0.01进位到0.05" },
        { label: "0,5进位体积" },
        { label: "0.01进位到0.1" },
      ],
    },
  },
  {
    label: "开始重量",
    prop: "startWeight",
    width: 200,
    operate: {
      type: "input",
      field: "startWeight",
    },
  },
  {
    label: "结束重量",
    prop: "endWeight",
    width: 200,
    operate: {
      type: "input",
      field: "endWeight",
    },
  },
  {
    label: "首重重量",
    prop: "firstWeight",
    width: 200,
    operate: {
      type: "input",
      field: "firstWeight",
    },
  },
  {
    label: "首重价格",
    prop: "firstPrice",
    width: 200,
    operate: {
      type: "input",
      field: "firstPrice",
    },
  },
  {
    label: "续重重量",
    prop: "continueWeight",
    width: 200,
    operate: {
      type: "input",
      field: "continueWeight",
    },
  },
  {
    label: "计算公式",
    prop: "calculationFormula",
    width: 200,
    operate: {
      type: "input",
      field: "calculationFormula",
    },
  },
  {
    label: "起始时间",
    prop: "startTime",
    width: 200,
    operate: {
      type: "datePicker",
      field: "startTime",
    },
  },
  {
    label: "截止时间",
    prop: "datePicker",
    width: 200,
    operate: {
      type: "datePicker",
      field: "endTime",
    },
  },
  {
    label: "宝贝地址",
    prop: "goodsAddress",
    width: 200,
    operate: {
      type: "input",
      field: "goodsAddress",
    },
  },
  {
    label: "会员等级",
    prop: "membershipLevel",
    width: 200,
    operate: {
      type: "input",
      field: "membershipLevel",
    },
  },
  {
    label: "创建人",
    prop: "createBy",
    width: 200,
  },
  {
    label: "创建时间",
    prop: "createTime",
    otherOptions: {},
    width: 150,
  },
];

export const costCalculate = [
  {
    label: "仓库",
    type: "select",
    field: "warehouseId",
    optionsKey: "warehouseName",
    optionsValue: "id",
    options: store.state.custom_dict.warehouse,
  },

  {
    label: "目的地",
    type: "select",
    field: "destinationId",
    optionsKey: "destinationName",
    optionsValue: "destinationId",
    options: store.state.custom_dict.destination,
  },
  {
    label: "快件类型",
    type: "select",
    field: "cargoTypeId",
    optionsKey: "cargoName",
    optionsValue: "id",
    options: store.state.custom_dict.category,
  },
  {
    label: "时效",
    type: "select",
    field: "timeEfficiencyId",
    optionsKey: "name",
    optionsValue: "id",
    options: store.state.custom_dict.timely,
  },
  {
    label: "店铺",
    type: "select",
    field: "shopId",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop,
  },
  {
    label: "费用类型",
    type: "select",
    field: "feeType",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "自提价格",
        value: 5,
      },
    ],
  },
  {
    label: "自提点",
    type: "select",
    required: true,
    field: "selfPickupPointId",
    optionsKey: "selfPickupPointName",
    optionsValue: "id",
    options: [],
  },
  {
    label: "测算重量",
    type: "input",
    required: true,
    field: "calculateWeight",
  },
];
